<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants" %>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/invDataEntry.do"/>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();  %>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>

<script language="javascript">
var binListSize = 0;
function selectProcessType()
{
   var form = document.invDataEntryform;

   if( form.processType.value == '0' )
   {
        form.action.value = 'processTypes';
        form.submit();
        return;
   }
   if( form.processStepId != null )
   {
	    form.processStepId.value='0';
   }

   form.action.value="partNumbers";
   form.submit();
}

function selectPartNumber()
{
   var form = document.invDataEntryform;

   if( form.processStepId.value == '0' )
   {
        form.action.value = 'partNumbers';
        form.submit();
        return;
   }
   if( form.locationId != null )
   {
	    form.locationId.value='0';
   }

   form.action.value="locations";
   form.submit();
}

function loadVendorLocations()
{
   var form = document.invDataEntryform;

   if( form.locationId.value == '0' )
   {
        form.action.value   = 'locations';
        form.submit();
        return;
   }
   if( form.fabLotNo != null )
   {
	    form.fabLotNo.value='0';
   }
   form.action.value="fabLotNumbers";
   form.submit();
}

function loadFabLotnumbers()
{
    var form = document.invDataEntryform;

    if( form.fabLotNo.value == '0' )
    {
        form.action.value   = "fabLotNumbers";
	    form.submit();
    	return ;
    }
   if( form.fabLotNo.value == '-1' )
   {
       form.action.value="loadLotInfo";
       form.submit();
       return ;
   }
   if( form.lotId != null )
   {
	    form.lotId.value='0';
   }
    form.action.value   = "lotNumbers";
	form.submit();
}

function loadLotnumbers()
{
    var form = document.invDataEntryform;

    if( form.lotId.value == '0' )
    {
        form.action.value   = "lotNumbers";
	    form.submit();
    	return ;
    }
    form.action.value   = "loadLotInfo";
	form.submit();
}

function loadLotInfo()
{
    var form = document.invDataEntryform;

    form.action.value="loadLotInfo";
    form.submit();
}

function loadShopOrders()
{
    var form = document.invDataEntryform;

    if( form.processType.value == "FAB" || form.processType.value == "CP" || form.processType.value == "BUMPING")
    {
        form['invLotDetails.waferIds'].disabled = false;
    }

    form.action.value="shopOrderNo";
    form.submit();
}


var dateElement = "";
function openCalendar(dateValue)
{
    dateElement = dateValue;
	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
	newWindow.moveTo(550,180);
	newWindow.focus();
}

function assignDate(passedValue)
{
	dateElement.value=passedValue;
	window.focus();
}

function dieBankBinDataEntry()
{
	var pa=document.getElementById("message");
	pa.innerHTML = '';
    var pa1=document.getElementById("binTable");
    if( pa1.style.display == 'none')
    {
        pa1.style.display = "block";
    }
    else
    {
        pa1.style.display = "none";
    }

}
function addMore()
{
    var tab = document.getElementById ("binTable");
    var index = tab.rows.length;

    var newRow = tab.insertRow ( index-1 );
    var newCell = newRow.insertCell(-1);
    newCell.align = "center"
    var htmltext = '<input type="text" name="invLotDetails.binList['+parseInt(binListSize,10)+'].waferId" size=6 class="valuetxfield" onkeypress="javascript:allowInteger()">';
    newCell.innerHTML = htmltext;

    /*newCell = newRow.insertCell();
    newCell.align = "center"
    htmltext = '<input type="text" name="invLotDetails.binList['+parseInt(binListSize,10)+'].binNo" size=6 class="valuetxfield" onkeypress="javascript:allowInteger()">';
    newCell.innerHTML = htmltext;*/

    newCell = newRow.insertCell(-1);
    newCell.align = "center"
    htmltext = '<input type="text" name="invLotDetails.binList['+parseInt(binListSize,10)+'].binQty" size=8 class="valuetxfield" onkeypress="javascript:allowInteger()" onchange= "javascript:calculateBinTotal();" >';
    newCell.innerHTML = htmltext;

    binListSize++;
}

function calculateBinTotal()
{
   var form = document.invDataEntryform;
   var totalQty = 0;
   
   for ( var i=0; i<binListSize; i++ )
   {
      if (form['invLotDetails.binList['+i+'].binQty'].value != '' )
      {
          if( !isValidInteger( form['invLotDetails.binList['+i+'].binQty'] ) )
          {
             return;
          }

          totalQty += parseInt(form['invLotDetails.binList['+i+'].binQty'].value );
       }
   }

    if ( form.fabLotNo.value =="-1" )
    {
        form['invLotDetails.dieQtyIn'].value  = totalQty;
    }
    else
    {
        if ( form.lotId.value == "-1" || parseInt(form.lotId.value) > 0 )
        {
           form['invLotDetails.dieQtyIn'].value  = totalQty;
        }
    }
}
        
function finalSave()
{
    var form = document.invDataEntryform;
	var pa=document.getElementById("message");
	pa.innerHTML = '';

    if(productSelected(form)==false)
    {
        return;
    }
    if(locationSelected(form)==false)
    {
        return;
    }
    /*if(lotNoSelected(form)==false)
    {
        return;
    }*/
    if (form.fabLotNo.value == "-1")
    {
        if (form['invLotDetails.fabLotNumber'].value == '')
        {
            pa.innerHTML = "<li>Enter Fab Lot Number</li>";
            form['invLotDetails.fabLotNumber'].focus();
            return;
        }
        if (form['invLotDetails.fabLotNumber'].value.indexOf("'") != "-1")
        {
            pa.innerHTML = "<li>Single quotation is not acceptable in Fab Lot Number</li>";
            form['invLotDetails.fabLotNumber'].focus();
            return;
        }
        if (form['invLotDetails.vendorLotNumber'].value == '')
        {
            pa.innerHTML = "<li>Enter Vendor Lot Number</li>";
            form['invLotDetails.vendorLotNumber'].focus();
            return;
        }
        if (form['invLotDetails.vendorLotNumber'].value.indexOf("'") != "-1")
        {
            pa.innerHTML = "<li>Single quotation is not acceptable in Vendor Lot Number</li>";
            form['invLotDetails.vendorLotNumber'].focus();
            return;
        }
    }
    if(form.fabLotNo.value != "-1")
    {
        if(form.lotId.value =="-1")
        {
             if(form['invLotDetails.vendorLotNumber'].value=='')
            {
                pa.innerHTML = "<li>Enter Vendor Lot Number</li>";
                form['invLotDetails.vendorLotNumber'].focus();
                return;
            }
            if( form['invLotDetails.vendorLotNumber'].value.indexOf("'") != "-1" )
            {
                pa.innerHTML = "<li>Single quotation is not acceptable in Vendor Lot Number</li>";
                form['invLotDetails.vendorLotNumber'].focus();
                return;
            }
        }
    }

    var totalQty = 0;
    for ( var i=0; i<binListSize-1; i++ )
    {
        for (var j = i + 1; j < binListSize; j++ )
        {
            if ( form['invLotDetails.binList['+i+'].waferId'].value != "" && form['invLotDetails.binList['+j+'].waferId'].value != "" && form['invLotDetails.binList['+i+'].waferId'].value == form['invLotDetails.binList['+j+'].waferId'].value )
            {
                pa.innerHTML = "<li>Duplicate Wafer Id should not be allowed";
                form['invLotDetails.binList['+j+'].waferId'].focus();
                return;
            }
        }
    }

    for ( var i=0; i<binListSize; i++ )
    {

      if( !isValidInteger( form['invLotDetails.binList['+i+'].waferId'] ) )
      {
         return;
      }

      totalQty += parseInt(form['invLotDetails.binList['+i+'].binQty'].value );

      if (form['invLotDetails.binList['+i+'].waferId'].value != '' && form['invLotDetails.binList['+i+'].waferId'].value == 0  )
      {
          pa.innerHTML = "<li>Zero value is not permitted for wafer Id, Please enter greater than Zero";
          form['invLotDetails.binList['+i+'].waferId'].focus();
          return;
       }
       if ( form['invLotDetails.binList['+i+'].waferId'].value != '' &&  form['invLotDetails.binList['+i+'].waferId'].value > 25 )
       {
           pa.innerHTML = "<li>Please enter wafer Id less than 25";
           form['invLotDetails.binList['+i+'].waferId'].focus();
           return;
       }
       if ( form['invLotDetails.binList['+i+'].binQty'].value != '' && form['invLotDetails.binList['+i+'].waferId'].value == '' )
      {
           pa.innerHTML = "<li>Please enter wafer Id";
           form['invLotDetails.binList['+i+'].waferId'].focus();
           return;
      }

      if ( form.grossDie.value != '' && form.grossDie.value > 0 )
      {
          if ( parseInt(form['invLotDetails.binList['+i+'].binQty'].value) > form.grossDie.value ) 
          {
            pa.innerHTML = "<li>Bin qty should not be greater than GDPW <font color=blue> " + form.grossDie.value + "</font> for Wafer Id: <font color=blue>" + form['invLotDetails.binList['+i+'].waferId'].value + " </font>";
            form['invLotDetails.binList['+i+'].binQty'].focus();
            return;
          }
      }
      if(form.processType.value != "WAFER STORE")
      {
           if ( form['invLotDetails.dieQtyIn'].value < totalQty )
           {
               pa.innerHTML = "<li>sum of Bin Qty (" +totalQty + ") should be equal or less than Die QtyIn";
               form['invLotDetails.dieQtyIn'].focus();
               return;
           }
       }
    }

    if( form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE" )
    {
        if (form['invLotDetails.waferQtyIn'].value == '')
        {
            form['invLotDetails.waferQtyIn'].focus();
            pa.innerHTML = "<li>Enter Wafer Quantity In</li>";
            return;
        }
        if (parseInt(form['invLotDetails.waferQtyIn'].value) == 0)
        {
            pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In, Please enter greater than Zero";
            form['bumpLotDetails.waferQtyIn'].focus();
            return;
        }
        if (form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE")
        {
            if (isValidInteger(form['invLotDetails.waferQtyIn']) == false)
            {
                return;
            }
            if (isValidInteger(form['invLotDetails.waferQtyOut']) == false)
            {
                return;
            }
        }
    }
    if( form.processType.value == "DIE BANK" || form.processType.value == "FINISHED GOODS" || form.processType.value == "CLASS STORE")
    {
        if (form['invLotDetails.dieQtyIn'].value == '')
        {
            form['invLotDetails.dieQtyIn'].focus();
            pa.innerHTML = "<li>Enter Quantity In</li>";
            return;
        }
        if (parseInt(form['invLotDetails.dieQtyIn'].value) == 0)
        {
            pa.innerHTML = "<li>Zero value is not permitted for Quantity In, Please enter greater than Zero";
            form['invLotDetails.dieQtyIn'].focus();
            return;
        }

    }
    if(form['invLotDetails.dateOut'].value!='')
    {
        if (form.processType.value == "DIE BANK" || form.processType.value == "FINISHED GOODS" || form.processType.value == "CLASS STORE")
        {

            if ( parseInt (form['invLotDetails.dieQtyIn'].value) == 0 )
            {
                pa.innerHTML = "<li>Zero value is not permitted for Quantity In";
                form['invLotDetails.dieQtyIn'].focus();
                return;
            }
            if ( chkDate ( form['invLotDetails.dateOut'].value , 'DateOut ' , 'Y' ) == false )
            {
                  pa.innerHTML = errMsg;
                  form['invLotDetails.dateOut'].focus();
                  return;
            }
            if(form['invLotDetails.dieQtyOut'].value=='')
            {
                pa.innerHTML = "Enter Quantity Out";
                return;
            }
        }
        if (form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE")
        {

            if ( parseInt (form['invLotDetails.waferQtyIn'].value) == 0 )
            {
                pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In";
                form['invLotDetails.waferQtyIn'].focus();
                return;
            }
            if ( chkDate ( form['invLotDetails.dateOut'].value , 'DateOut ' , 'Y' ) == false )
            {
                  pa.innerHTML = errMsg;
                  form['invLotDetails.dateOut'].focus();
                  return;
            }
            if(form['invLotDetails.waferQtyOut'].value=='')
            {
                pa.innerHTML = "Enter wafer Quantity Out";
                return;
            }
        }
    }
    if (form.processType.value == "DIE BANK" || form.processType.value == "FINISHED GOODS" || form.processType.value == "CLASS STORE")
    {
        if (form['invLotDetails.dieQtyOut'].value != '')
        {
            if (!isInteger(form['invLotDetails.dieQtyOut'].value))
            {
                pa.innerHTML = "Enter valid Quantity Out, Quantity Out must be number";
                return;
            }
            if (parseInt(form['invLotDetails.dieQtyOut'].value) == 0)
            {
                pa.innerHTML = "<li>Zero value is not permitted for Quantity Out, Enter greater than Zero";
                form['invLotDetails.dieQtyOut'].focus();
                return;
            }
            if (parseInt(form['invLotDetails.dieQtyOut'].value) > parseInt(form['invLotDetails.dieQtyIn'].value))
            {
                pa.innerHTML = "Quantity Out can not be greater than Quantity In";
                form['invLotDetails.dieQtyOut'].focus();
                return;
            }
        }
    }
    if (form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE")
    {
        if (!isInteger(form['invLotDetails.waferQtyOut'].value))
        {
            pa.innerHTML = "Enter valid Wafer Quantity Out, Wafer Quantity Out must be number";
            return;
        }
        if (parseInt(form['invLotDetails.waferQtyOut'].value) == 0)
        {
            pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity Out, Enter greater than Zero";
            form['invLotDetails.waferQtyOut'].focus();
            return;
        }
        if (parseInt(form['invLotDetails.waferQtyOut'].value) > parseInt(form['invLotDetails.waferQtyIn'].value))
        {
            pa.innerHTML = "Wafer Quantity Out can not be greater than Wafer Quantity In";
            form['invLotDetails.waferQtyOut'].focus();
            return;
        }
    }
    if (form['invLotDetails.dateIn'].value == '')
    {
        pa.innerHTML = "Enter Date In";
        form['invLotDetails.dateIn'].focus();
        return;
    }
    if( form['invLotDetails.dateOut'].value != '')
    {
        if (!validateDateOut(formatDateAsMMDDYYYY(form['invLotDetails.dateIn'].value), formatDateAsMMDDYYYY(form['invLotDetails.dateOut'].value)))
        {
            pa.innerHTML = "Date Out cannot be less than Date In";
            form['invLotDetails.dateOut'].focus();
            return;
        }
    }
    if( form['invLotDetails.lotCategory'].value == '' )
	{
		pa.innerHTML = "<li>Select Lot Category";
        form['invLotDetails.lotCategory'].focus();
        return;
	}
    if( form['invLotDetails.lotStatus'].value == '' )
	{
		pa.innerHTML = "<li>Select Lot Status";
        form['invLotDetails.lotStatus'].focus();
        return;
	}
    if(form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE")
    {
        if (form['invLotDetails.waferQtyOut'].value != '' && form['invLotDetails.dateOut'].value == '')
        {
            pa.innerHTML = "Enter Date Out";
            form['invLotDetails.dateOut'].focus();
            return;
        }
    }
    if( form.processType.value == "DIE BANK" || form.processType.value == "FINISHED GOODS" || form.processType.value == "CLASS STORE")
    {
        if (form['invLotDetails.dieQtyOut'].value != '' && form['invLotDetails.dateOut'].value == '')
        {
            pa.innerHTML = "Enter Date Out";
            form['invLotDetails.dateOut'].focus();
            return;
        }
    }
    if( form['invLotDetails.comments'].value.trim().length > 1000 )
	{
		pa.innerHTML = "<li>Comments should not be greater than 1000 characters";
        form['invLotDetails.comments'].focus();
        return;
	}
    if( form.processType.value == "WAFER STORE" || form.processType.value == "BUMP STORE" )
    {
        if ( isWaferIdsValid() == false )
        {
            return;
        }
        form['invLotDetails.waferIds'].disabled = false;
    }
    form.action.value="save";
    form.submit();
}

function productSelected(form)
{
    var pa=document.getElementById("message");
    var x = form.processStepId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li>Select Product Name</li>";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}

function lotNoSelected(form)
{

    var pa=document.getElementById("message");
    var x = form.lotId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li>Select Lot Number</li>";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}

function isValidInteger(temp)
{
    errors = "";
    var pa=document.getElementById("message");

    if(!isInteger(temp.value))
    {
        errors = "<li>Please enter a valid integer</li>";
        pa.innerHTML = errors;
        temp.focus();
        return false;
    }

    return true;
}

function locationSelected(form)
{
    var pa=document.getElementById("message");
    var x = form.locationId;

    for(var i=0; i< x.length; i++)
    {
        if(x.options[i].selected)
        {
	        if(x.options[i].value == "0")
            {
	            pa.innerHTML = "<li>Select Location</li>";
                x.focus();
	            return false;
            }
        }
    }
    return true;
}

function invWaferDataEntry()
{
    var pa=document.getElementById("message");
	pa.innerHTML = '';
    var form = document.invDataEntryform;
    var waferQtyInCtrl = form['invLotDetails.waferQtyIn'];
    waferQty =  waferQtyInCtrl.value

    if ( waferQtyInCtrl.value.trim() == '' )
    {
        pa.innerHTML = "<li>Wafer Quantity In cannot be blank</li>";
        waferQtyInCtrl.focus();
        return;
    }
    if ( !isInteger( waferQtyInCtrl.value ) )
    {
        pa.innerHTML = "<li>Please enter valid Ship Qty, Wafer Quantity In must be number</li>";
        waferQtyInCtrl.focus();
        return;
    }

    if ( parseInt ( waferQtyInCtrl.value, 10 ) == 0 )
    {
        pa.innerHTML = "<li>Zero value is not permitted for Wafer Quantity In, Please enter greater than Zero</li>";
        waferQtyInCtrl.focus();
        return;
    }
    if ( parseInt ( waferQtyInCtrl.value, 10 ) > 25 )
    {
        pa.innerHTML = "<li>Wafer Quantity In cannot be greater than 25</li>";
        waferQtyInCtrl.focus();
        return;
    }

    newWindow = window.open('<%=chipTracContext%>/jsp/operations/inv_wafer_data_entry.jsp?waferQty='+waferQty,'invWaferPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=600,height=375,resizable=yes');
    newWindow.focus();
}

function isWaferIdsValid()
{
    var pa=document.getElementById("message");
	pa.innerHTML = '';
    var form = document.invDataEntryform;
    var waferQtyInCtrl = eval( form['invLotDetails.waferQtyIn']);
    waferQty = waferQtyInCtrl.value;
    var waferIds = form['invLotDetails.waferIds'].value;

    if( waferQty != null )
    {
        if (waferIds == '')
        {
            pa.innerHTML = '<li>Please enter Wafer Ids</li>';
            return false;
        }
    }
    if ( waferIds.charAt ( waferIds.length -1 ) != ';' ) //waferIds should end with ';' then only the following validation works
    {
        waferIds = waferIds + ";"
    }
    var waferIdsArr = waferIds.split(";");
    if ( parseInt ( waferQty, 10 ) > 0 )
    {
        if ( waferIdsArr != null )
        {
            if ( waferIdsArr.length == 1 && waferIdsArr[0] == "" )
            {
                pa.innerHTML = '<li>Please enter Wafer Ids</li>';
                return false;
            }
            if ( parseInt ( waferQty, 10 ) != parseInt ( waferIdsArr.length ) - 1 )
            {
                pa.innerHTML = '<li>Wafer Ids are not matched with the Wafer Quantity In </li>';
                return false;
            }
        }
    }
    return true;
}

function checkLength(element, size)
{
    if(	element.value.length >= size )
	{
		event.returnValue = false;
	}
}

function showBinInfo()
{
  var form = document.invDataEntryform;  
  var pa1=document.getElementById("binTable");
  if ( binListSize > 0 )
  {
       if ( form['invLotDetails.binList[0].waferId'].value != '' )
       {
            pa1.style.display = "block";
       }
  }
}

</script>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onload="showBinInfo()">
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
<!-- Side Navigation start -->
<%@ include file="/jsp/operations/dataentryMenu.jsp" %>
<!-- end of the side navigations -->
<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">
<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<html:form name="invDataEntryform" type="com.scalar.chiptrack.operations.dataentry.inventory.forms.InventoryDataEntryForm" action="/invDataEntry">
<input type="hidden" name="action" value="<%= (String)request.getAttribute("action")%>">
<TABLE border="0" width="90%" align=center>
<TR><TD colspan=5 class="NArialW" align="center">Inventory Data Entry</TD></TR>
<TR><TD colspan=5>&nbsp;</TD></TR>
<TR><TD colspan=5 class='NArialL'><strong><FONT id="message" styleClass="NArialL" color='FF0000'></FONT></strong></TD></TR>
<TR><TD colspan=5>
  <chiptrack:info styleClass="NArialL" />
  <chiptrack:errors styleClass="NArialL" />
  <chiptrack:messages type="info" styleClass="NArialL" />
</TD></TR>
<logic:equal name="showMessage" value="TRUE">
    <tr><td colspan=5 align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></TD></TR>
</logic:equal>
<TR><TD COLSPAN=5>&nbsp;</TD></TR>
<TR><TD>
<TABLE  border="0" width="100%" cellpadding="1" cellspacing="5">
    <TR>
        <logic:present name="processTypeList" scope="request">
            <TD width="20%" class="NArialL">Process Type:</TD>
            <TD width="30%" class="NArialL">
            <html:select property="processType" name="invDataEntryform" styleClass="txfield" onchange="selectProcessType()" >
            <html:option value="0">Select Process Type</html:option>
            <html:options collection="processTypeList" property="value" labelProperty="label"/>
            </html:select>
            </TD>
        </logic:present>
        <logic:notPresent name="processTypeList" scope="request">
            <TD width="20%" class="NArialL">&nbsp;</TD>
            <TD width="30%" class="NArialL">&nbsp;</TD>
        </logic:notPresent>
        <logic:present name="partNumbersList" >
            <TD width="25%"><font class="NArialL">Product Name:</font></TD>
            <TD width="25%" class="NArialL">
                <html:select property="processStepId"  name="invDataEntryform" styleClass="txfield" onchange="selectPartNumber()">
                <html:option value="0">Select Part Number</html:option>
                <html:options collection="partNumbersList" property="value" labelProperty="label"/>
                </html:select>
            </TD>
        </logic:present>
        <logic:notPresent name="partNumbersList" scope="request">
            <TD width="25%" class="NArialL">&nbsp;</TD>
            <TD width="25%" class="NArialL">&nbsp;</TD>
        </logic:notPresent>
    </TR>
    <TR>
        <logic:present name="locationList" scope="request">
            <TD width="20%"><font class="NArialL">Location:</font></TD>
            <TD width="30%" class="NArialL">
                <html:select property="locationId" name="invDataEntryform" styleClass="txfield" onchange="loadVendorLocations()">
                    <html:option value="0">Select Location</html:option>
                    <html:options collection="locationList" property="value" labelProperty="label"/>
                </html:select>
            </TD>
        </logic:present>
        <logic:notPresent name="locationList" scope="request">
            <TD width="20%" class="NArialL">&nbsp;</TD>
            <TD width="30%" class="NArialL">&nbsp;</TD>
        </logic:notPresent>
        <logic:present name="invFabLotNoList" scope="request">
            <TD width="25%"><font class="NArialL">Fab Lot Number:</font></TD>
            <TD width="25%" class="NArialL">
                <html:select property="fabLotNo"  name="invDataEntryform" styleClass="txfield" onchange="loadFabLotnumbers()" >
                    <html:option value="0">Select Fab Lot  Number</html:option>
                    <html:option value="-1">--New Fab Lot Number--</html:option>
                    <html:options collection="invFabLotNoList" property="value" labelProperty="label"/>
                </html:select>
            </TD>
        </logic:present>
        <logic:notPresent name="invFabLotNoList" scope="request">
            <TD width="25%" class="NArialL">&nbsp;</TD>
            <TD width="25%" class="NArialL">&nbsp;</TD>
       </logic:notPresent>
    </TR>
    <TR>
        <logic:notEqual name="invDataEntryform" property="fabLotNo" value="-1">
            <logic:present name="invList" scope="request">
                <TD width="20%"><font class="NArialL">Lot Number:</font></TD>
                <TD width="30%" class="NArialL">
                    <html:select property="lotId"  name="invDataEntryform" styleClass="txfield" onchange="loadLotnumbers()" >
                        <html:option value="0">Select Lot  Number</html:option>
                        <html:option value="-1">--New Lot Number--</html:option>
                        <html:options collection="invList" property="value" labelProperty="label"/>
                    </html:select>
                </TD>
            </logic:present>
        </logic:notEqual>
        <logic:notPresent name="invFabLotNoList" scope="request">
            <TD width="20%" class="NArialL">&nbsp;</TD>
            <TD width="30%" class="NArialL">&nbsp;</TD>
       </logic:notPresent>
    </TR>
    <TR>
        <TD colspan="4"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
    </TR>
    <logic:notEqual name="invDataEntryform" property="fabLotNo" value="0">
        <nested:nest property="invLotDetails">
            <logic:equal name="invDataEntryform" property="fabLotNo" value="-1">
                <TR>
                    <TD width="20%"><font class="NArialL">Fab Lot Number:<font color="red"><b>*</b></font></font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="fabLotNumber" styleClass="txfield" size="25" maxlength="50"/></TD>
                    <TD width="25%"><font class="NArialL">Vendor Lot Number:<font color="red"><b>*</b></font></font></TD>
                    <TD width="25%" class="NArialL"><nested:text property="vendorLotNumber" styleClass="txfield"  size="25" maxlength="50" /></TD>
                </TR>
            </logic:equal>
            <logic:equal name="invDataEntryform" property="lotId" value="-1">
                <TR>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                    <TD width="25%"><font class="NArialL">Vendor Lot Number:<font color="red"><b>*</b></font></font></TD>
                    <TD width="25%" class="NArialL"><nested:text property="vendorLotNumber" styleClass="txfield"  size="25" maxlength="50" /></TD>
                </TR>
            </logic:equal>
            <logic:equal name="invDataEntryform" property="fabLotNo" value="-1">
                <logic:equal value='DIE BANK' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                 <logic:equal value='CLASS STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='FINISHED GOODS' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='WAFER STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Wafer Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='BUMP STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Wafer Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <TR>
                    <TD width="20%"><font class="NArialL">Lot Category:<font color="red"><b>*</b></font></font></TD>
                    <TD width="30%" class="NArialL"><nested:select property="lotCategory" styleClass="txfield" >
                                            <html:option value="">Select Lot Category</html:option>
                                            <html:options collection="lotCategoryList" property="value" labelProperty="label"/>
                                            </nested:select></TD>
                    <TD width="25%"><font class="NArialL">Lot Status:<font color="red"><b>*</b></font></font></TD>
                    <TD width="25%" class="NArialL"><nested:select property="lotStatus" styleClass="txfield" >
                                            <html:option value="">Select Lot Status</html:option>
                                            <html:options collection="lotStatusList" property="value" labelProperty="label"/>
                                            </nested:select></TD>
                </TR>
                <TR>
                    <TD width="20%"><font class="NArialL">Date In:<font color="red"><b>*</b></font></font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="dateIn" styleClass="txfield" size="16" maxlength="10" />
                    <a href="javascript:openCalendar(document.invDataEntryform['invLotDetails.dateIn'])">
                    <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a></TD>
                    <TD width="25%"><font class="NArialL">Date Out:</font></TD>
                    <TD width="25%" class="NArialL"><nested:text property="dateOut" styleClass="txfield" size="16" maxlength="10" />
                    <a href="javascript:openCalendar(document.invDataEntryform['invLotDetails.dateOut'])">
                    <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a></TD>
                </TR>
                <logic:equal value='WAFER STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Ids:</font></TD>
                        <TD width="30%" class="NArialL" ><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                        <TD width="25%"></TD>
                        <td width="25%"><font class="NArialL">
                        <a href="javascript:invWaferDataEntry();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                        Wafer Data Entry</a><font color="red"><b>*</b></font></font></td>
                    </TR>
                </logic:equal>
                <logic:equal value='BUMP STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Ids:</font></TD>
                        <TD width="30%" class="NArialL" ><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                        <TD width="25%"></TD>
                        <td width="25%"><font class="NArialL">
                        <a href="javascript:invWaferDataEntry();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                        Wafer Data Entry</a><font color="red"><b>*</b></font></font></td>
                    </TR>
                </logic:equal>
                <%--<TR>
                    <TD width="20%"><font class="NArialL">Date Code:</font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="dateCode" styleClass="txfield" size="16" maxlength="10" /></TD>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                    <TD width="25%" class="NArialL">&nbsp;&nbsp;</TD>
                </TR>--%>
                <TR>
                    <TD width="20%"><font class="NArialL">Date Code:</font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="dateCode" styleClass="txfield" size="16" maxlength="10" /></TD>
                    <logic:equal value='FINISHED GOODS' name="invDataEntryform" property="processType">
                        <TD width="25%"><font class="NArialL">Assembly Vendor</font></TD>
                        <TD width="25%" class="NArialL"> <nested:select  property="assemblyVendor" styleClass="txfield" >
                                            <html:option value="-1">Select Assembly Vendor</html:option>
                                            <html:options collection="assemblyVendorsList" property="value" labelProperty="label"/>
                                            </nested:select>
                    </logic:equal>
                    <logic:notEqual value='FINISHED GOODS' name="invDataEntryform" property="processType">
                        <logic:equal value='DIE BANK' name="invDataEntryform" property="processType">
                                    <TD width="5%">&nbsp;&nbsp;</TD>
                                    <TD width="45%" class="NArialL" align= "left" ><a href="javascript:dieBankBinDataEntry();" onMouseOver="window.status='Click here to Entry DieBank Bin Data';return true" onMouseOut="window.status='';return true">
                     Bin Data Entry</a></TD>
                        </logic:equal>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                     </logic:notEqual>
                </TR>

                <tr>
                    <td>&nbsp;</td>
                    <td colspan="3">
                         <table align="center" border="0" id="binTable" style="display:none;" width="40%">

                        <tr>
                            <td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Wafer Id</font></td>
                            <%--<td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Bin No</font></td>--%>
                            <td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Bin Qty</font></td>
                        </tr>

                         <nested:iterate property="binList">
                         <tr>
                            <nested:empty property="waferId">
                            <td align='center'><nested:text property="waferId" readonly="false" size="6" styleClass="valuetxfield" onkeypress="javascript:allowInteger()"></nested:text></td>
                            </nested:empty>
                             <nested:notEmpty property="waferId" >
                            <td align='center'><nested:text property="waferId" readonly="true" size="6" styleClass="valuetxfield"></nested:text></td>
                             </nested:notEmpty>
                            <%--<td align='center'><nested:text property="binNo"  size="6" styleClass="valuetxfield" onkeypress="javascript:allowInteger()"></nested:text></td>--%>
                            <td align='center'><nested:text property="binQty" size="8" styleClass="valuetxfield" onkeypress="javascript:allowInteger()" onchange= "javascript:calculateBinTotal();"></nested:text></td>
                          </tr>
                         </nested:iterate>
                          <nested:size id="binCount" property="binList"></nested:size>
                            <script type="text/javascript">
                                binListSize = <%= binCount.intValue()%>;
                            </script>
                        <tr>
                            <td>&nbsp;</td>
                            <!--<td>&nbsp;</td>-->
                           <TD align=right><a href="javascript:addMore();"><img src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" border="0" onmouseover="window.status='Click to Add Bin Info';return true" onmouseout="window.status='';return true" title="Click here to Add Bin Info"/></a></TD>
                        </tr>
                        </table>
                    </td>
                </tr>
                
                <TR>
                    <TD class="NArialL"><font class="NArialL">Comments:</font></TD>
                    <TD colspan="3">
                    <nested:textarea property="comments" onkeypress="javascript:checkLength(this, 1000)" styleClass="txfield" rows="4" cols="80" /></TD>
                </TR>
          </logic:equal>
          <logic:notEqual name="invDataEntryform" property="lotId" value="0">
                <logic:equal value='DIE BANK' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='FINISHED GOODS' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                 <logic:equal value='CLASS STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="dieQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="dieQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='WAFER STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Wafer Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <logic:equal value='BUMP STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Quantity In:<font color="red"><b>*</b></font></font></TD>
                        <TD width="30%" class="NArialL"><nested:text property="waferQtyIn" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                        <TD width="25%"><font class="NArialL">Wafer Quantity Out:</font></TD>
                        <TD width="25" class="NArialL"><nested:text property="waferQtyOut" size="16" styleClass="valuetxfield" maxlength="7" onkeypress="allowInteger()"/></TD>
                    </TR>
                </logic:equal>
                <TR>
                    <TD width="20%"><font class="NArialL">Lot Category:<font color="red"><b>*</b></font></font></TD>
                    <TD width="30%" class="NArialL"><nested:select property="lotCategory" styleClass="txfield" >
                                            <html:option value="">Select Lot Category</html:option>
                                            <html:options collection="lotCategoryList" property="value" labelProperty="label"/>
                                            </nested:select></TD>
                    <TD width="25%"><font class="NArialL">Lot Status:<font color="red"><b>*</b></font></font></TD>
                    <TD width="25%" class="NArialL"><nested:select property="lotStatus" styleClass="txfield" >
                                            <html:option value="">Select Lot Status</html:option>
                                            <html:options collection="lotStatusList" property="value" labelProperty="label"/>
                                            </nested:select></TD>
                </TR>
                <TR>
                    <TD width="20%"><font class="NArialL">Date In:<font color="red"><b>*</b></font></font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="dateIn" styleClass="txfield" size="16" maxlength="10" />
                    <a href="javascript:openCalendar(document.invDataEntryform['invLotDetails.dateIn'])">
                    <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a></TD>
                    <TD width="25%"><font class="NArialL">Date Out:</font></TD>
                    <TD width="25%" class="NArialL"><nested:text property="dateOut" styleClass="txfield" size="16" maxlength="10" />
                    <a href="javascript:openCalendar(document.invDataEntryform['invLotDetails.dateOut'])">
                    <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20></a></TD>
                </TR>
                <logic:equal value='WAFER STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Ids:</font></TD>
                        <TD width="30%" class="NArialL" ><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                        <TD width="25%"></TD>
                        <td width="25%"><font class="NArialL">
                        <a href="javascript:invWaferDataEntry();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                        Wafer Data Entry</a><font color="red"><b>*</b></font></font></td>
                    </TR>
                </logic:equal>
                <logic:equal value='BUMP STORE' name="invDataEntryform" property="processType">
                    <TR>
                        <TD width="20%"><font class="NArialL">Wafer Ids:</font></TD>
                        <TD width="30%" class="NArialL" ><nested:text property="waferIds" disabled="true" styleClass="txfield"/></TD>
                        <TD width="25%"></TD>
                        <td width="25%"><font class="NArialL">
                        <a href="javascript:invWaferDataEntry();" onMouseOver="window.status='Click here to Enter Wafer Data Entry';return true" onMouseOut="window.status='';return true">
                        Wafer Data Entry</a><font color="red"><b>*</b></font></font></td>
                    </TR>
                </logic:equal>
                <TR>
                    <TD width="20%"><font class="NArialL">Date Code:</font></TD>
                    <TD width="30%" class="NArialL"><nested:text property="dateCode" styleClass="txfield" size="16" maxlength="10" /></TD>
                    <logic:equal value='FINISHED GOODS' name="invDataEntryform" property="processType">
                        <TD width="25%"><font class="NArialL">Assembly Vendor</font></TD>
                        <TD width="25%" class="NArialL"> <nested:select  property="assemblyVendor" styleClass="txfield" >
                                            <html:option value="-1">Select Assembly Vendor</html:option>
                                            <html:options collection="assemblyVendorsList" property="value" labelProperty="label"/>
                                            </nested:select>
                    </logic:equal>
                    <logic:notEqual value='FINISHED GOODS' name="invDataEntryform" property="processType">
                     <logic:equal value='DIE BANK' name="invDataEntryform" property="processType">
                                    <TD width="5%">&nbsp;&nbsp;</TD>
                                    <TD width="45%" class="NArialL" align= "left" ><a href="javascript:dieBankBinDataEntry();" onMouseOver="window.status='Click here to Entry DieBank Bin Data';return true" onMouseOut="window.status='';return true">
                     Bin Data Entry</a></TD>
                        </logic:equal>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                    <TD width="25%">&nbsp;&nbsp;</TD>
                     </logic:notEqual>
                </TR>
                 <tr>
                    <td>&nbsp;</td>
                    <td colspan="3">
                         <table align="center" border="0" id="binTable" style="display:none;" width="40%">

                        <tr>
                            <td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Wafer Id</font></td>
                            <%--<td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Bin No</font></td>--%>
                            <td width="10%" align='center' bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Bin Qty</font></td>
                        </tr>

                         <nested:iterate property="binList">
                         <tr>
                            <nested:empty property="waferId">
                            <td align='center'><nested:text property="waferId" readonly="false" size="6" styleClass="valuetxfield" onkeypress="javascript:allowInteger()"></nested:text></td>
                            </nested:empty>
                             <nested:notEmpty property="waferId" >
                            <td align='center'><nested:text property="waferId" readonly="true" size="6" styleClass="valuetxfield"></nested:text></td>
                             </nested:notEmpty>
                            <%--<td align='center'><nested:text property="binNo"  size="6" styleClass="valuetxfield" onkeypress="javascript:allowInteger()"></nested:text></td>--%>
                            <td align='center'><nested:text property="binQty" size="8" styleClass="valuetxfield" onkeypress="javascript:allowInteger()" onchange= "javascript:calculateBinTotal();"></nested:text></td>
                          </tr>
                         </nested:iterate>
                          <nested:size id="binCount" property="binList"></nested:size>
                            <script type="text/javascript">
                                binListSize = <%= binCount.intValue()%>;
                            </script>
                        <tr>
                            <td>&nbsp;</td>
                            <%--<td>&nbsp;</td>--%>
                           <TD align=right><a href="javascript:addMore();"><img src="<%=chipTracContext%>/jsp/includes/images/addmore.gif" border="0" onmouseover="window.status='Click to Add Bin Info';return true" onmouseout="window.status='';return true" title="Click here to Add Bin Info"/></a></TD>
                        </tr>
                        </table>
                    </td>
                </tr>

                <TR>
                    <TD class="NArialL"><font class="NArialL">Comments:</font></TD>
                    <TD colspan="3">
                    <nested:textarea property="comments" onkeypress="javascript:checkLength(this, 1000)" styleClass="txfield" rows="4" cols="80" /></TD>
                </TR>
            </logic:notEqual>
        </nested:nest>
        <TR>
            <TD colspan="4"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></TD>
        </TR>
        <logic:equal name="invDataEntryform" property="fabLotNo" value="-1">
            <TR>
                <TD colspan="4" align=center>
                    <a href="javascript:finalSave();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to Save Inventory Data';return true" onmouseout="window.status='';return true" title="Click here to Save Inventory Data"></a>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="<%=chipTracContext%>/invDataEntry.do"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17" onmouseover="window.status='Click to Cancel Changes';return true" onmouseout="window.status='';return true" title="Click here to Cancel Changes"></a>
                </TD>
            </TR>
        </logic:equal>
        <logic:notEqual name="invDataEntryform" property="lotId" value="0">
            <TR>
                    <TD colspan="4" align=center>
                        <a href="javascript:finalSave();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" width="53" height="17" onmouseover="window.status='Click to Save Inventory Data';return true" onmouseout="window.status='';return true" title="Click here to Save Inventory Data"></a>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <a href="<%=chipTracContext%>/invDataEntry.do"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/cancel.gif" width="53" height="17" onmouseover="window.status='Click to Cancel Changes';return true" onmouseout="window.status='';return true" title="Click here to Cancel Changes"></a>
                    </TD>
            </TR>
        </logic:notEqual>
       <html:hidden name="invDataEntryform" property="grossDie"/>
    </logic:notEqual>
    </TABLE>
   </TD>
 </TR>
</TABLE>
</html:form>
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->
</BODY>
</HTML>
<%--                  
<% } catch(Exception e) { e.printStackTrace(); }%>--%>
